package JMU1.ti402;

import java.util.Scanner;

/**
 * @author Lenovo
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNext()){
            String line= scanner.nextLine();
            int sum=0;
            for(char c:line.toCharArray()){
                if(Character.isDigit(c)){
                    sum+=c-'0';
                }
            }
            System.out.println(sum);
        }
    }
}
